// DebugData.h: interface for the CDebugData class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DEBUGDATA_H__97B99FBD_3BEE_11D3_BD7A_00C04F9902DF__INCLUDED_)
#define AFX_DEBUGDATA_H__97B99FBD_3BEE_11D3_BD7A_00C04F9902DF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>
#include <stdio.h>

#include "MyTypedef.h"

typedef struct debugDataTag
{
    int m_nLineNo;     // line number in the file
    word addr;
}SDebugData;

class CDebugData  
{
public:
	BOOL GetSourceLine( word address, unsigned int & line );
	word GetMemoryAddress(unsigned nSrcLine);
	unsigned GetSourceLine(word address);
	void Write(word nAddress,int nSrcLine);
	void Close();
    void Read();
	void Open(char *szFileName,char *mode="rt");
	CDebugData();
	virtual ~CDebugData();

    // data members
protected:
    SDebugData *m_pData;   // this contains the debug data.
    FILE    *m_pFile;

    // 8085 memory address to Source line number mapping
    CMap<word,word,unsigned,unsigned> m_cAddrToSrc; 
    // Source line number to 8085 memory address  mapping 
    CMap<unsigned,unsigned,word,word> m_cSrcToAddr; 
};

#endif // !defined(AFX_DEBUGDATA_H__97B99FBD_3BEE_11D3_BD7A_00C04F9902DF__INCLUDED_)
